home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 11 / FM Towns Free Software Collection 11.iso / t_os / data / dora / doradnld.plp < prev    next >
Text File  |  1995-08-15  |  13KB  |  519 lines

  1. /*    ダウンロード制御ファイル指定の有無の判定処理    */
  2. %AUTODNLD{
  3.     footnote({ダウンロード制御ファイル指定の有無を判定しています});
  4.     case    (@filechk(UP2|{doradown.ctl}),
  5.         {Yes},
  6.         {footnote({自動ダウンロード処理を行います});
  7.         AUTOdown(UP2|{doradown.ctl});
  8.         delfile(UP2|{doradown.bak});
  9.         renname(UP2|{doradown.ctl},{doradown.bak});
  10.         case    (@filechk(UP2|{doradown.rsv}),
  11.             {Yes},
  12.             {renname(UP2|{doradown.rsv},{doradown.ctl})}
  13.             );
  14.         });
  15.     };
  16. /*ダウンレート計算処理ステップ1*/
  17. %RTtime    {[datafile]
  18.     dispoff(!DEBUG);
  19.     command(CDIR2|{escctr -d}|TEMP2|{ -K}|TEMP2|{ }|TEMP2|{_rattxt.tmp});
  20.     dispoff({No});
  21.     var n[2];var Fsize[10];n:={0};
  22.     %Gfsize @read(TEMP2|{_rattxt.tmp});
  23.     Fsize:=@head(Gfsize,{数 :},{ (})*128;im({No});
  24.     BRTtime(datafile);
  25.     };
  26.  
  27. /* ダウンロード成功処理 */
  28. %yatta1    {[datafile]
  29.     %Gfsize @laststr(128);
  30.     DOWNSTOP;delfile(TEMP2|{_rattxt.tmp});
  31.     write(TEMP2|{_rattxt.tmp},Gfsize);
  32.     dispoff(!DEBUG);mkdir2(@body(datafile,,{\}));dispoff({No});
  33.     loop    ({
  34.         wait    (3,{im({Yes})}
  35.             ,{ファイルの補足説明を表示しますか},
  36.             {
  37.             type({Y\n});dispoff(!DEBUG);mkdir2(@body(docfile,,{\}));
  38.             dispoff({No});DOWNCHECK;receive(docfile);
  39.             wait(Wtime2,,{Protocol},);
  40.             WaitMK;DOWNSTOP;im({No})
  41.             }
  42.             ,{補足説明:},
  43.             {
  44.             dispoff(!DEBUG);mkdir2(@body(docfile,,{\}));
  45.             dispoff({No});DOWNCHECK;receive(docfile);
  46.             wait(Wtime2,,{項目},);DOWNSTOP;
  47.             wait(Wtime2,,{Protocol},);
  48.             WaitMK;im({No})
  49.             }
  50.             ,{説明はありません},{im({Yes})}
  51.             ,{Protocol},
  52.             {WaitMK;im({No})}
  53.             );
  54.         });
  55.     type(binop|{\n});
  56.     wait    (3,    {
  57.             %timeP @linetime;
  58.             RECbin(datafile);type({\n});
  59.             wait(WtimeD,{otto3},
  60.                 {,Q},{WaitMK;type({Q\n})},
  61.                 {,?,0},{WaitMK;type({0|Q\n})});
  62.             %timePS    @linetime-timeP-8;
  63.             RTtime(datafile);
  64.             }
  65.         ,{で止める},
  66.         {
  67.         %timeP @linetime;
  68.         RECbin(datafile);type({\n});
  69.         wait    (WtimeD,{otto3},
  70.             {,Q},{WaitMK;type({Q\n})},
  71.             {,?,0},{WaitMK;type({0|Q\n})});
  72.         %timePS    @linetime-timeP-8;
  73.         RTtime(datafile);
  74.         }
  75.         ,{で中断},
  76.         {
  77.         %timeP @linetime;
  78.         RECbin(datafile);type({\n});
  79.         wait    (WtimeD,{otto3},
  80.             {,Q},{WaitMK;type({Q\n})},
  81.             {,?,0},{WaitMK;type({0|Q\n})});
  82.         %timePS    @linetime-timeP-8;
  83.         RTtime(datafile);
  84.         }
  85.         ,{失敗し},{otto3}
  86.         ,{ボードの指定が違います},
  87.         {display({データ番号が違うため次の処理を行います\n});otto3}
  88.         );
  89.     DOWNSTART;
  90.     };
  91.  
  92. /* ダウンロード不成功処理 */
  93. %otto3    {
  94.     SNDMSG({okasi_f.snd});
  95.     write(UP2|{doradown.rsv},{保留;}|linebuf);
  96.     wait    (Wtime2,,
  97.         {,?,Q},{WaitMK;type({Q\n})},
  98.         {,0,Q},{WaitMK;type({Q\n})},
  99.         {,?,0},{WaitMK;type({0|Q\n})},
  100.         {Operation},{WaitMK;type({Q|0|Q\n})});
  101.     im({No})
  102.     };
  103. /* ダウンロード実行の判定 */
  104. %GOyatta{[dataname,datafile]
  105.     wait(Wtime2,{type(dataname|{\n})},
  106.         {[RET]},{type(dataname|{\n})});
  107.     loop    ({
  108.         wait    (3,{im({Yes})}
  109.             ,{ファイルが見つか},{otto3;im({No})}
  110.             ,{参照数},{yatta1(datafile);im({No})}
  111.             ,{登録者},{yatta1(datafile);im({No})}
  112.             ,{送信者},{yatta1(datafile);im({No})}
  113.             );
  114.         });
  115.     im({No})
  116.     };
  117. /* ダウンロード処理 */
  118. %DLIBDOWN{
  119.     [forum,libno,dataname,docfile,datafile]
  120.  
  121. /* ダウンロード実行処理 */
  122.     footnote(libno|{番ライブラリの}|dataname|{をダウンロードします});
  123.     type({\n});WaitMK;
  124.     loop    ({
  125.         wait(3,{type({\n});im({Yes})}
  126.         ,{>>},{
  127.         case    (forum=NET,
  128.             {Yes},{type({F#}|libno|{|D\n})},
  129.             {No},{type({F#}|libno|{|}|forum|{|D\n})}
  130.             );im({No})}
  131.         ,{MAIN},{WaitMK;
  132.         case    (forum=NET,
  133.             {Yes},{type({F#}|libno|{|D\n})},
  134.             {No},{type({F#}|libno|{|}|forum|{|D\n})}
  135.             );
  136.         });
  137.     });
  138. loop    ({
  139.     wait(3,{im({Yes})}
  140.     ,{このボードではダウンロードは出来ません。},
  141.     {display({ダウンロードが禁止されている為、次の処理を行います\n});
  142.     SNDMSG({okasi_f.snd});
  143.     wait(Wtime2,,{,?,0},{type({0|Q\n})});im({No})
  144.     }
  145.     ,{ポイント不足},{otto3}
  146.     ,{ダウンロード制限},{otto3}
  147.     ,{そのボードには入れ},{otto3}
  148.     ,{ボードが見つか},{otto3}
  149.     ,{,?,0},{type({\n});otto3}
  150.     ,{ファイルが見つか},{otto3}
  151.     ,{パスワードが違います},{otto3}
  152.     ,{ファイル名は},{WaitMK;GOyatta(dataname,datafile)}
  153.     ,{ファイル名を入力},{WaitMK;GOyatta(dataname,datafile)}
  154.     ,{DOWNLOAD},{WaitMK;GOyatta(dataname,datafile)}
  155.     );
  156.     });
  157.     };
  158. /*      メンバー全員のプロフィールダウン処理    */
  159. %ALLPRO{
  160.     type({P|L\n});
  161.     loop    ({
  162.         wait    (3,{im({Yes})},
  163.             {始めのIDは?},
  164.             {
  165.             footnote({メンバー全員のプロフィールダウンします});
  166.             mkdir2(LOG2|{PROFILE});
  167.             DOWNCHECK;delfile(LOG2|{PROFILE\profile.dat});
  168.             WaitMK;type({\n});
  169.             receive(LOG2|{PROFILE\profile.dat});
  170.             loop    ({
  171.                 wait    (3,{im({Yes})},
  172.                 {,?,0},{WaitMK;type({0\n});im({No})},
  173.                 {MAIN},{im({No})}
  174.                     )
  175.                 });
  176.             DOWNSTOP;DOWNSTART;im({No})
  177.             });
  178.         });
  179.     };
  180. /* プロフィールダウンロード処理 */
  181. %PROFDOWN{
  182.     [uid]
  183.     var    UID[90];
  184.     footnote(uid|{の}|{プロフィール情報をダウンロードします});
  185.     dispoff(!DEBUG);mkdir2(LOG2|{profile});dispoff({No});
  186.     UID:=uid;
  187.     loop    ({
  188.         %id1 @head(UID,{,});
  189.         UID:=@body(UID,{,});
  190.             dispoff(!DEBUG);
  191.             command({del }|LOG2|{profile\}|id1|{.prf});
  192.             dispoff({No});DOWNCHECK;
  193.             receive(LOG2|{profile\}|id1|{.prf});
  194.             type({P|P}|id1);type({\n});
  195.         loop    ({
  196.             wait(3,{im({Yes})},
  197.                 {) >},{type({0|Q\n});
  198.                    wait(3,,{,?,O},{},{[N]},{type({\n})});
  199.                 im({No})});
  200.             });
  201.             DOWNSTOP;DOWNSTART;
  202.         case(UID,{},{im({No})},,{im({Yes})});
  203.         });
  204.     };
  205. /* ファイルボードの最新登録状況を見る処理 */
  206. %FILBORD{    [lib]
  207.     footnote({ファイルボード}|lib|{の最新登録状況を見ます});
  208.         mkdir2(LOG2|{DATALIB});
  209.         delfile(LOG2|{DATALIB\#}|lib|{DLIB.DAT});
  210.         WaitMK;type({F#}|lib|{\n});
  211.         LIBprom1(lib,NET);
  212.     };
  213. /* データライブラリからの自動ダウンロード処理     */
  214. %AUTOdwn1{
  215.     %CdirD    @getcdir;
  216.     case    (@head(linebuf,{=}),
  217.         {forum},
  218.         {DLIBDOWN(
  219.             @tail(linebuf,{forum=},{;}),
  220.             @tail(linebuf,{libno=},{;}),
  221.             @tail(linebuf,{dataname=},{;}),
  222.             @tail(linebuf,{docfile=},{;}),
  223.             @tail(linebuf,{datafile=},{;}));
  224.         im({Yes});
  225.         },
  226.         {allprofile},{ALLPRO;im({Yes})},
  227.         {profile},{PROFDOWN(@tail(linebuf,{profile=},{;}));im({Yes})},
  228.         {filbord},{FILBORD(@tail(linebuf,{filbord=},{;}));im({Yes})},
  229.         {},{im({No})},
  230.         ,{im({Yes})}
  231.         )
  232.     };
  233. %AUTOdown{
  234.     [file]
  235.     case    (@filechk(file),
  236.         {Yes},
  237.         {
  238.         line:=0;
  239.         loop    ({
  240.             line:=line+1;
  241.             linebuf:={};
  242.             linebuf:=@read(file,line,1);
  243.             case    (@getchar(linebuf,1,5)={保留;},
  244.                 {Yes},
  245.                 {write(UP2|{doradown.rsv},linebuf);im({Yes})},
  246.                 {No},
  247.                 {AUTOdwn1},
  248.                 );
  249.             });
  250.         AUTOdwn1;
  251.         },
  252.         {No},
  253.         {
  254.         SNDMSG({okasi_f.snd});
  255.         display({\n}|file|{制御ファイルがありません\n});
  256.         });
  257.     };
  258. /* バイナリメールのダウン と 削除 */
  259. %downBML{
  260.     footnote({メール処理実行中});
  261.     WaitMK;type(BINop|{\n});
  262.     wait(3,,{メール},,{送信は},,{MAIL},);
  263.     delfile(TEMP2|{_bmaltxt.tmp});type({\n});
  264.     loop    ({
  265.         wait(5,{im({Yes});type({\n})},
  266.         {Protocol},{WaitMK;retMAIN;SKIP},
  267.         {メイン},{WaitMK;retMAIN;SKIP},
  268.         {メイン},{WaitMK;retMAIN;SKIP},
  269.         {MAIN},{WaitMK;retMAIN;SKIP},
  270.         {ヘルプ 表示},{WaitMK;retMAIN;SKIP},
  271.         {してねっ☆},{WaitMK;retMAIN;SKIP},
  272.         {MAIL},{WaitMK;type({L\n});im({No})});
  273.         });
  274.     wait(3,,{姫子},{}
  275.         ,{from top},,{------},,{ワイルドカード},);
  276.     type({\n});
  277.     DOWNCHECK;receive(TEMP2|{_bmaltxt.tmp});
  278.     wait    (Wtime2,,{MAIL},);
  279.     DOWNSTOP;DOWNSTART;
  280.     dispoff(!DEBUG);
  281.     command(CDIR2|{escctr -d}|TEMP2|{ -K}|TEMP2|{ }|TEMP2|{_bmaltxt.tmp});
  282.     dispoff({No});
  283.     case    (@filechk(TEMP2|{_bmaltxt.tmp})={},
  284.         {Yes},{footnote({Bメールデータリストの読み込みに失敗しました})},
  285.         {No},{footnote({Bメールデータリストの読み込みに成功しました})}
  286.         );
  287.     BREDsyor;
  288.     };
  289. /*DAWN前処理*/
  290. %BREDsyor{
  291.     var Bchk[2000];var BMflag[3];
  292.     %comA{存在しま};%comB{はない};%comC{はあり};
  293.     %comD{.LZH\n};%comE{.JPG\n};%comF{がありません};
  294.     %ckBMail{var n[2]; n:=0;var N[2]; N:=@noline(Bchk);
  295.     footnote({Bメールリストの確認処理を開始します});
  296.     loop    ({    n:=n+1;
  297.         %a    @getline(Bchk,n,1);BMflag:={};
  298.         case    (n>N,
  299.             {Yes},{im({No})},,
  300.             {
  301.             case    (BINop={M},
  302.                 {Yes},
  303.                 {case    (a={} || @exist(a,comD)={No}
  304.                     && @exist(a,comE)={No},
  305.                     {Yes},{im({Yes})},,
  306.                     {footnote(@tail(a,{ },{\n})|
  307.                         {ファイル確認しました});
  308.                     ckBMail2;
  309.                     im({Yes})
  310.                     })
  311.                 },,
  312.                 {case    (a={},
  313.                     {Yes},{im({Yes})},,
  314.                     {footnote({BMAIL確認中です});
  315.                     ckBMail2;
  316.                     im({Yes})
  317.                     })
  318.                 });
  319.             });
  320.         });
  321.         footnote({Bメールの読み込み処理を終了しました});
  322.         };
  323.     %ckBMail2{
  324.         case    (@exist(a,ID),
  325.             {No},{im({Yes})},
  326.             {Yes},
  327.             {
  328.             case    (
  329.                 BINop={Z}&&@getchar(a,46,1)={.}
  330.                 &&@strip(@head(@getchar(a,6,9),{ }))<>ID
  331.                 ||
  332.                 BINop={M}&&@getchar(a,41,1)={b}
  333.                 &&@strip(@head(@getchar(a,6,9),{ }))<>ID
  334.                 ||
  335.                 BINop={M}&&@getchar(a,42,1)={b}
  336.                 &&@strip(@head(@getchar(a,6,9),{ }))<>ID
  337.                 ||
  338.                 BINop={MB}
  339.                 &&@getchar(a,46,1)={.}
  340.                 && @strip(@head(@getchar(a,6,9),{ }))<>ID
  341.                 ||
  342.                 BINop={MB}
  343.                 &&@getchar(a,42,17)={-----------------}
  344.                 && @strip(@head(@getchar(a,6,9),{ }))<>ID
  345.                 ||
  346.                 BINop={MB}
  347.                 && @getchar(a,26,17)={-----------------}
  348.                 && @strip(@head(@getchar(a,6,9),{ }))<>ID,
  349.                 {Yes},{BdwnLOD(a);BMflag:={DEL}});
  350.             case     (BMALDEL={Yes}&& UnDele<>{Yes} && BINop<>{M},
  351.                 {Yes},{BDELsyori(a,BMflag);UnDele:={No}}
  352.                 )
  353.             });
  354.         };
  355.     Bchk:=@read(TEMP2|{_bmaltxt.tmp});
  356.     case    (@exist(Bchk,comA)||@exist(Bchk,comB)
  357.             ||@exist(Bchk,comC)||@exist(Bchk,comF),
  358.         {Yes},{footnote({バイナリメールは存在しません})},
  359.         {No},{footnote({Bメールの読み込み処理を開始します});ckBMail});
  360.     preRetM;
  361.     };
  362. /*DAWN処理*/
  363. %BdwnLOD{[a]
  364.     var Fsize[10];var datafile[64];var docfile[64];var name[30];
  365.     %Bytes    @tail(@head(a,{KB}),{ });
  366.     Fsize:=    @tail(@head(a,{KB}),{ })*128;
  367.     case    (BINop,
  368.         {Z},{name:=@strip(@body(a,{ B },Bytes))},
  369.         {M},{name:=@tail(a,{ },{\n})},
  370.         {MB},
  371.         {case    (@getchar(a,52,1)={.},
  372.             {Yes},{name:=@strip(@getchar(a,44,12))},
  373.             {No},{name:=@strip(@getchar(a,60,8))|
  374.                     @getchar(a,68,4)
  375.             });
  376.         });
  377.     datafile:=LOG2|{BMAIL\}|name;    
  378.     docfile:=LOG2|{BMAIL\}|@body(name,,{.})|{.ggg};
  379.     dispoff(!DEBUG);display(name);mkdir2(@body(docfile,,{\}));dispoff({No});
  380.     type(@getchar(a,2,3)-BNo|{\n});DOWNCHECK;
  381.     case    (@exist(name,{.}),{Yes},
  382.         {
  383.         case    (BINop,
  384.             {M},
  385.             {delfile(TEMP2|{_size.tmp});
  386.             wait    (Wtime2,
  387.                 ,{RET},{receive(TEMP2|{_size.tmp})}
  388.                 ,{ファイル名},{receive(TEMP2|{_size.tmp})}
  389.                 ,{File},{receive(TEMP2|{_size.tmp})});
  390.             %fsize @tail(@read(TEMP2|{_size.tmp}),{= },{ bytes});                case    (@exist(fsize,{,}),
  391.                 {Yes},
  392.                 {Fsize:=@conma(fsize)},
  393.                 {No},{Fsize:=fsize}
  394.                 );
  395.             },
  396.             ,{receive(docfile)});
  397.         });
  398.     loop    ({
  399.         wait    (3,{im({Yes})}
  400.             ,{Protocol},{im({No})}
  401.             ,{[32minary},{type({B\n});im({No})}
  402.             ,{B:inary},{type({B\n});im({No})}
  403.             )
  404.         });
  405.     WaitMK;DOWNSTOP;DOWNSTART;type(binop|{\n});
  406.     wait    ({5},    {
  407.             %timeP @linetime;RECbin(datafile);
  408.             %timePS @linetime-timeP-8;
  409.             type({\n});BRTtime(datafile);
  410.             wait    (WtimeD,,
  411.                 {MAIN},,
  412.                 {MAIL},,
  413.                 {Mail},,
  414.                 {成功},)
  415.             }
  416.         ,{で中断},
  417.         {
  418.         %timeP @linetime;RECbin(datafile);
  419.         %timePS    @linetime-timeP-8;
  420.         type({\n});BRTtime(datafile);
  421.         wait    (WtimeD,,
  422.             {MAIN},,
  423.             {MAIL},,
  424.             {Mail},,
  425.             {成功},);
  426.         }
  427.         ,{失敗し},{UnDele:={Yes}}
  428.         ,{ボードの指定が違います},
  429.         {display({データ番号が違うため次の処理を行います\n})}
  430.         );im({Yes})
  431.     };
  432. /*削除処理*/
  433. %BDELsyori{[a,BMflag]
  434.     var name[30];var BmNo[3];
  435.     %Bytes    @tail(@head(a,{KB}),{ });
  436.     footnote({Bメールの削除処理をします。>削除モード=}|DelBML);
  437.     case    (BINop,
  438.         {Z},{name:=@strip(@body(a,{ B },Bytes))},
  439.         {MB},
  440.         {case    (@getchar(a,52,1)={.}||@getchar(a,52,1)={o},
  441.             {Yes},{name:=@strip(@getchar(a,44,12))},
  442.             {No},{
  443.             case    (@getchar(a,46,1)={.}||@getchar(a,46,1)={o},
  444.                 {Yes},{name:=@strip(@getchar(a,2,3)-BNo)},
  445.                 {No},{name:=@strip(@getchar(a,60,8))|
  446.                     @getchar(a,68,4)
  447.                 });
  448.             });
  449.         });
  450.         BmNo:=@strip(@getchar(a,2,3));
  451.     case    (@getchar(a,46,1)={o} && BINop={Z}
  452.         ||
  453.         @getchar(a,46,1)={o} && BINop={MB}
  454.         ||
  455.         @getchar(a,42,1)={b} && BINop={M}    /*葵ネット*/
  456.         ||
  457.         @getchar(a,42,17)<>{-----------------} 
  458.         && @getchar(a,26,17)<>{-----------------}
  459.         && BINop={MB} && @getchar(a,42,1)<>{.}
  460.         ||
  461.         BMflag={DEL},
  462.         {Yes},
  463.         {
  464.         case    (DelBML={all},
  465.             {Yes},
  466.             {display({\n}|name|{を削除します\n});
  467.             type({D|}|name|{|K|Y\n});
  468.             wait    (Wtime2,
  469.                 ,{BMAIL},
  470.                 {type(@getchar(a,2,3)-BNo|{|K\n})}
  471.                 ,{削除},{});BNo:=BNo+1
  472.             },
  473.             {No},
  474.             {
  475.             case    (DelBML={other} &&
  476.                 @strip(@head(@getchar(a,6,9),{ }))<>ID,
  477.                 {Yes},
  478.                 {display({\n}|name|{を削除します\n});
  479.                 type({D|}|name|{|K|Y\n});
  480.                 wait    (Wtime2,
  481.                     ,{BMAIL},
  482.                     {type(@getchar(a,2,3)-BNo|{|K\n})}
  483.                     ,{削除},{});BNo:=BNo+1
  484.                 },
  485.                 {No},{type({\n})
  486.                 });
  487.             });
  488.         wait    (Wtime2,,
  489.             {Cannot find}
  490.             ,{footnote({このファイルは見つかりません})},
  491.             {MAIL},,
  492.             {失敗},,
  493.             {何番を削除しますか},{type({\n})},
  494.             {ファイル},{footnote({メールNo.}|@getchar(a,2,3)-BNo|
  495.                 {番を削除しました})},
  496.             {削除},{type({\n});footnote({メールNo.}|
  497.                 @getchar(a,2,3)-BNo|{番を削除しました})})
  498.             },,{footnote({Bメール処理実行中});
  499.         })
  500.     };
  501. var    line    [3];    /* 制御ファイル行カウンタ*/
  502. var    linebuf    [258];    /* 制御文バッファ*/
  503. var    BNo[3];BNo:=0;    /* BMAIL ナンバー削除調整用*/
  504. var    UnDele[3];
  505. case    (mopver={Win31},
  506.     {Yes},
  507.     {case    (BINty,
  508.         {Z-modem}
  509.         ,{RecDir(LOG2|{BMAIL})});/*受信ディレクトリの指定*/
  510.     });
  511. case    (BmalON={Yes} && BINop<>{},{Yes},{downBML});
  512. case    (mopver={Win31},
  513.     {Yes},
  514.     {case    (BINty,
  515.         {Z-modem}
  516.         ,{RecDir(FSW)});/*受信ディレクトリの指定*/
  517.     });
  518.     DOWNSTART;AUTODNLD;
  519.